home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume19 / sipp2.0 / patch01 next >
Encoding:
Internet Message Format  |  1991-04-27  |  24.9 KB

  1. From: jonas-y@isy.liu.se (Jonas Yngvesson)
  2. Newsgroups: comp.sources.misc
  3. Subject: v19i001:  sipp2.0 - a library for 3D graphics, Patch01
  4. Message-ID: <1991Apr28.022805.7955@sparky.IMD.Sterling.COM>
  5. Date: 28 Apr 91 02:28:05 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: fc587531 2c43c5b6 430a67b8 f62eaf5c
  8.  
  9. Submitted-by: Jonas Yngvesson <jonas-y@isy.liu.se>
  10. Posting-number: Volume 19, Issue 1
  11. Archive-name: sipp2.0/patch01
  12. Patch-To: sipp2.0: Volume 16, Issue 5-10
  13.  
  14. This posting contains a patch file which takes sipp ver. 2.0 to ver. 2.0.1.
  15. It corrects all bugs in ver. 2.0 which have been reported to us so far.
  16.  
  17. For those of you who don't know it, SIPP is a library for creating
  18. 3-dimensional scenes and rendering them using a scan-line z-buffer algorithm.
  19. A scene is built up of objects which can be transformed with rotation,
  20. translation and scaling. The objects form hierarchies where each object can
  21. have arbitrarily many subobjects and subsurfaces. A surface is a number of
  22. connected polygons which are rendered with Phong interpolation of the surface
  23. normals.
  24.  
  25. Have fun!       Jonas & Inge
  26. ------------------------------- CUT HERE ---------------------------------
  27. #! /bin/sh
  28. # This is a shell archive.  Remove anything before this line, then feed it
  29. # into a shell via "sh file" or similar.  To overwrite existing files,
  30. # type "sh file -c".
  31. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  32. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  33. # Contents:  Patch01
  34. # Wrapped by kent@sparky on Sat Apr 27 21:10:26 1991
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. echo If this archive is complete, you will see the following message:
  37. echo '          "shar: End of archive."'
  38. if test -f 'Patch01' -a "${1}" != "-c" ; then 
  39.   echo shar: Will not clobber existing file \"'Patch01'\"
  40. else
  41.   echo shar: Extracting \"'Patch01'\" \(22161 characters\)
  42.   sed "s/^X//" >'Patch01' <<'END_OF_FILE'
  43. Xdiff -c -r sipp-2.0/Makefile sipp-2.0.1/Makefile
  44. X*** sipp-2.0/Makefile    Thu Dec 20 15:54:47 1990
  45. X--- sipp-2.0.1/Makefile    Tue Jan 15 07:12:04 1991
  46. X***************
  47. X*** 40,45 ****
  48. X--- 40,48 ----
  49. X  LEX = lex
  50. X  
  51. X  
  52. X+ SHELL = /bin/sh
  53. X+ RM = rm -f
  54. X+ 
  55. X  # LIBDIR is where libsipp.a will be placed when you make install.
  56. X  # INCLUDEDIR is where the include files will be placed when you make install.
  57. X  # MANDIR is where the manuals will be placed when you make install.
  58. Xdiff -c -r sipp-2.0/README sipp-2.0.1/README
  59. X*** sipp-2.0/README    Thu Dec 20 15:00:18 1990
  60. X--- sipp-2.0.1/README    Mon Apr 22 19:18:33 1991
  61. X***************
  62. X*** 1,5 ****
  63. X  *******************************************************************
  64. X!              sipp 2.0  --  3d rendering package
  65. X  
  66. X               by         Jonas Yngvesson   jonas-y@isy.liu.se
  67. X                          Inge Wallin       ingwa@isy.liu.se
  68. X--- 1,5 ----
  69. X  *******************************************************************
  70. X!              sipp 2.0.1  --  3d rendering package
  71. X  
  72. X               by         Jonas Yngvesson   jonas-y@isy.liu.se
  73. X                          Inge Wallin       ingwa@isy.liu.se
  74. X***************
  75. X*** 8,21 ****
  76. X               Sweden
  77. X  *******************************************************************
  78. X  
  79. X! This is the beta-test release of version 2.0 of SIPP, the SImple
  80. X! Polygon Processor. SIPP is a library for creating 3-dimensional
  81. X! scenes and rendering them using a scan-line z-buffer algorithm. A
  82. X! scene is built up of objects which can be transformed with rotation,
  83. X! translation and scaling. The objects form hierarchies where each
  84. X! object can have arbitrarily many subobjects and subsurfaces. A
  85. X! surface is a number of connected polygons which are rendered with
  86. X! Phong interpolation of the surface normals.
  87. X  
  88. X  The library has an internal database for the objects that is to be
  89. X  rendered. Objects can be installed in, and removed from, this
  90. X--- 8,21 ----
  91. X               Sweden
  92. X  *******************************************************************
  93. X  
  94. X! This is SIPP, the SImple Polygon Processor, version 2.0.1. SIPP is a
  95. X! library for creating 3-dimensional scenes and rendering them using a
  96. X! scan-line z-buffer algorithm. A scene is built up of objects which
  97. X! can be transformed with rotation, translation and scaling. The
  98. X! objects form hierarchies where each object can have arbitrarily many
  99. X! subobjects and subsurfaces. A surface is a number of connected
  100. X! polygons which are rendered with Phong interpolation of the surface
  101. X! normals.
  102. X  
  103. X  The library has an internal database for the objects that is to be
  104. X  rendered. Objects can be installed in, and removed from, this
  105. X***************
  106. X*** 31,42 ****
  107. X  exist.
  108. X  
  109. X  The program has some bugs & limitations. See the BUGS entry in the
  110. X! manuals for more information.
  111. X  
  112. X  To install the library, edit the Makefile and type 'make install'. If
  113. X! Your system does not have the drand48() random number generator, change
  114. X! the macro RANDOM() in sipp.h to use the random number generator available
  115. X! on your system.
  116. X  
  117. X  If you only want to make the library but not install it, just type
  118. X  'make library'.
  119. X--- 31,43 ----
  120. X  exist.
  121. X  
  122. X  The program has some bugs & limitations. See the BUGS entry in the
  123. X! manuals for more information. All bugs in version 2.0 which were
  124. X! reported to us have been fixed though.
  125. X  
  126. X  To install the library, edit the Makefile and type 'make install'. If
  127. X! Your system does not have the drand48() random number generator,
  128. X! change the macro RANDOM() in sipp.h to use the random number
  129. X! generator available on your system.
  130. X  
  131. X  If you only want to make the library but not install it, just type
  132. X  'make library'.
  133. X***************
  134. X*** 54,59 ****
  135. X  then compile a library of object functions and let other people share
  136. X  the benefits.
  137. X  
  138. X! Linkoping 19 December 1990
  139. X  
  140. X                  enjoy! /Jonas & Inge
  141. X--- 55,60 ----
  142. X  then compile a library of object functions and let other people share
  143. X  the benefits.
  144. X  
  145. X! Linkoping 22 April 1991
  146. X  
  147. X                  enjoy! /Jonas & Inge
  148. XCommon subdirectories: sipp-2.0/demo and sipp-2.0.1/demo
  149. XCommon subdirectories: sipp-2.0/doc and sipp-2.0.1/doc
  150. XCommon subdirectories: sipp-2.0/libsipp and sipp-2.0.1/libsipp
  151. Xdiff -c -r sipp-2.0/demo/Makefile sipp-2.0.1/demo/Makefile
  152. X*** sipp-2.0/demo/Makefile    Thu Dec 20 15:47:17 1990
  153. X--- sipp-2.0.1/demo/Makefile    Tue Jan 15 04:38:35 1991
  154. X***************
  155. X*** 6,11 ****
  156. X--- 6,13 ----
  157. X  CC = cc
  158. X  CFLAGS = -O -I../libsipp
  159. X  
  160. X+ SHELL = /bin/sh
  161. X+ RM = rm -f
  162. X  
  163. X  SRCS = torustest.c cylindertest.c ellipsoid.c blocktest.c chain.c \
  164. X      teapot.c structure.c planettest.c isy90.c
  165. Xdiff -c -r sipp-2.0/demo/blocktest.c sipp-2.0.1/demo/blocktest.c
  166. X*** sipp-2.0/demo/blocktest.c    Wed Dec 12 14:20:48 1990
  167. X--- sipp-2.0.1/demo/blocktest.c    Tue Jan 15 04:36:15 1991
  168. X***************
  169. X*** 43,47 ****
  170. X      fp = fopen("block.ppm", "w");
  171. X      render_image(side, side, fp);
  172. X      printf("Done.\n");
  173. X- }
  174. X  
  175. X--- 43,48 ----
  176. X      fp = fopen("block.ppm", "w");
  177. X      render_image(side, side, fp);
  178. X      printf("Done.\n");
  179. X  
  180. X+     exit(0);
  181. X+ }
  182. Xdiff -c -r sipp-2.0/demo/chain.c sipp-2.0.1/demo/chain.c
  183. X*** sipp-2.0/demo/chain.c    Wed Dec 12 14:20:47 1990
  184. X--- sipp-2.0.1/demo/chain.c    Tue Jan 15 04:36:33 1991
  185. X***************
  186. X*** 77,80 ****
  187. X--- 77,82 ----
  188. X      fp = fopen("chain.ppm", "w");
  189. X      render_image(side, side, fp);
  190. X      printf("Done.\n");
  191. X+ 
  192. X+     exit(0);
  193. X  }
  194. Xdiff -c -r sipp-2.0/demo/cylindertest.c sipp-2.0.1/demo/cylindertest.c
  195. X*** sipp-2.0/demo/cylindertest.c    Wed Dec 12 14:20:51 1990
  196. X--- sipp-2.0.1/demo/cylindertest.c    Tue Jan 15 04:36:40 1991
  197. X***************
  198. X*** 46,49 ****
  199. X--- 46,51 ----
  200. X      fp = fopen("cylinder.ppm", "w");
  201. X      render_image(side, side, fp);
  202. X      printf("Done.\n");
  203. X+ 
  204. X+     exit(0);
  205. X  }
  206. Xdiff -c -r sipp-2.0/demo/ellipsoid.c sipp-2.0.1/demo/ellipsoid.c
  207. X*** sipp-2.0/demo/ellipsoid.c    Wed Dec 12 14:20:49 1990
  208. X--- sipp-2.0.1/demo/ellipsoid.c    Tue Jan 15 04:36:57 1991
  209. X***************
  210. X*** 47,50 ****
  211. X--- 47,52 ----
  212. X      fp = fopen("ellipsoid.ppm", "w");
  213. X      render_image(side, side, fp);
  214. X      printf("Done.\n");
  215. X+ 
  216. X+     exit(0);
  217. X  }
  218. Xdiff -c -r sipp-2.0/demo/isy90.c sipp-2.0.1/demo/isy90.c
  219. X*** sipp-2.0/demo/isy90.c    Wed Dec 19 11:43:12 1990
  220. X--- sipp-2.0.1/demo/isy90.c    Tue Jan 15 04:37:07 1991
  221. X***************
  222. X*** 116,119 ****
  223. X--- 116,121 ----
  224. X      view_focal(0.2);
  225. X      image = fopen("isy90.ppm", "w");
  226. X      render_image(siz, siz, image);
  227. X+ 
  228. X+     exit(0);
  229. X  }
  230. Xdiff -c -r sipp-2.0/demo/planettest.c sipp-2.0.1/demo/planettest.c
  231. X*** sipp-2.0/demo/planettest.c    Wed Dec 12 14:19:49 1990
  232. X--- sipp-2.0.1/demo/planettest.c    Tue Jan 15 04:37:19 1991
  233. X***************
  234. X*** 41,45 ****
  235. X  
  236. X      outfile = fopen("planet.ppm", "w");
  237. X      render_image(size, size, outfile);
  238. X- }
  239. X  
  240. X--- 41,46 ----
  241. X  
  242. X      outfile = fopen("planet.ppm", "w");
  243. X      render_image(size, size, outfile);
  244. X  
  245. X+     exit(0);
  246. X+ }
  247. Xdiff -c -r sipp-2.0/demo/structure.c sipp-2.0.1/demo/structure.c
  248. X*** sipp-2.0/demo/structure.c    Wed Dec 12 14:20:44 1990
  249. X--- sipp-2.0.1/demo/structure.c    Tue Jan 15 04:37:28 1991
  250. X***************
  251. X*** 103,107 ****
  252. X      fp = fopen("structure.ppm", "w");
  253. X      render_image(size, size, fp);
  254. X      printf("Done.\n");
  255. X- }
  256. X  
  257. X--- 103,108 ----
  258. X      fp = fopen("structure.ppm", "w");
  259. X      render_image(size, size, fp);
  260. X      printf("Done.\n");
  261. X  
  262. X+     exit(0);
  263. X+ }
  264. Xdiff -c -r sipp-2.0/demo/teapot.c sipp-2.0.1/demo/teapot.c
  265. X*** sipp-2.0/demo/teapot.c    Tue Dec 18 17:02:54 1990
  266. X--- sipp-2.0.1/demo/teapot.c    Tue Jan 15 04:37:36 1991
  267. X***************
  268. X*** 67,70 ****
  269. X--- 67,72 ----
  270. X      view_focal(0.25);
  271. X      image = fopen("teapot.ppm", "w");
  272. X      render_image(siz, siz, image);
  273. X+ 
  274. X+     exit(0);
  275. X  }
  276. Xdiff -c -r sipp-2.0/demo/torustest.c sipp-2.0.1/demo/torustest.c
  277. X*** sipp-2.0/demo/torustest.c    Wed Dec 12 14:20:54 1990
  278. X--- sipp-2.0.1/demo/torustest.c    Tue Jan 15 04:37:48 1991
  279. X***************
  280. X*** 48,51 ****
  281. X--- 48,53 ----
  282. X      fp = fopen("torus.ppm", "w");
  283. X      render_image(side, side, fp);
  284. X      printf("Done.\n");
  285. X+ 
  286. X+     exit(0);
  287. X  }
  288. Xdiff -c -r sipp-2.0/libsipp/Makefile sipp-2.0.1/libsipp/Makefile
  289. X*** sipp-2.0/libsipp/Makefile    Thu Dec 20 15:52:10 1990
  290. X--- sipp-2.0.1/libsipp/Makefile    Tue Jan 15 04:40:56 1991
  291. X***************
  292. X*** 6,11 ****
  293. X--- 6,13 ----
  294. X  CC = cc
  295. X  CFLAGS = -pipe -I. -DHAVE_NO_ALLOCA
  296. X  
  297. X+ SHELL = /bin/sh
  298. X+ RM = rm -f
  299. X  
  300. X  IHDRS = sipptypes.h geometric.h noise.h bezier.h
  301. X  EHDRS = sipp.h shaders.h primitives.h
  302. Xdiff -c -r sipp-2.0/libsipp/TODO sipp-2.0.1/libsipp/TODO
  303. X*** sipp-2.0/libsipp/TODO    Wed Dec 12 14:33:53 1990
  304. X--- sipp-2.0.1/libsipp/TODO    Fri Apr 12 22:44:04 1991
  305. X***************
  306. X*** 1,17 ****
  307. X- 
  308. X- Minor:
  309. X- 
  310. X  Make antialiasing optional with some kind of flag.
  311. X  
  312. X! [Have the program whistle while it works with a verbose flag.]
  313. X  
  314. X  Make it possible to render into a pixmap in core.
  315. X  
  316. X! Major:
  317. X  
  318. X  [Arbitrary number of "texture coordinates" (numbers to be
  319. X  interpolated over polygon surfaces).]
  320. X  
  321. X! [More sofisticated antialiasing (A-buffer??)]
  322. X  
  323. X! [Line image (without hidden lines) for preview.]
  324. X--- 1,24 ----
  325. X  Make antialiasing optional with some kind of flag.
  326. X  
  327. X! More sofisticated antialiasing.
  328. X  
  329. X  Make it possible to render into a pixmap in core.
  330. X  
  331. X! [New and better shading model (CG&A Nov 90)]
  332. X  
  333. X+ [Shaped lightsources, e.g. point, spotlight]
  334. X+ 
  335. X+ [Colored lightsources]
  336. X+ 
  337. X+ [Several rendering modes, e.g. wire frame, hidden line, flat shading, 
  338. X+  Gouraud shading]
  339. X+ 
  340. X  [Arbitrary number of "texture coordinates" (numbers to be
  341. X  interpolated over polygon surfaces).]
  342. X  
  343. X! [Have the program whistle while it works with a verbose flag.]
  344. X  
  345. X! [Shadows, see eg article in siggraph 87 about depth maps]
  346. X! 
  347. X! [Curved surface rendering (not siPp any longer)]
  348. X! 
  349. Xdiff -c -r sipp-2.0/libsipp/bumpy.c sipp-2.0.1/libsipp/bumpy.c
  350. X*** sipp-2.0/libsipp/bumpy.c    Fri Apr 12 22:36:14 1991
  351. X--- sipp-2.0.1/libsipp/bumpy.c    Wed Apr  3 20:05:27 1991
  352. X***************
  353. X*** 1,5 ****
  354. X  /*
  355. X!  * erode shader - simulates an eroded surface using noise
  356. X   */
  357. X  
  358. X  #include <math.h>
  359. X--- 1,5 ----
  360. X  /*
  361. X!  * bumpy shader - simulates an bumpy surfaces using noise and Dnoise
  362. X   */
  363. X  
  364. X  #include <math.h>
  365. X***************
  366. X*** 36,44 ****
  367. X      tmp.z = w * bd->scale;
  368. X  
  369. X      if ((bd->bumpflag && bd->holeflag)
  370. X!           || ((no = noise(tmp)) < 0.0 && bd->bumpflag)
  371. X            || (no > 0.0 && bd->holeflag)) {
  372. X!         tmp = Dnoise(tmp);
  373. X          len = sqrt(nx * nx + ny * ny + nz * nz);
  374. X          nx = nx / len + tmp.x;
  375. X          ny = ny / len + tmp.y;
  376. X--- 36,44 ----
  377. X      tmp.z = w * bd->scale;
  378. X  
  379. X      if ((bd->bumpflag && bd->holeflag)
  380. X!           || ((no = noise(&tmp)) < 0.0 && bd->bumpflag)
  381. X            || (no > 0.0 && bd->holeflag)) {
  382. X!         tmp = Dnoise(&tmp);
  383. X          len = sqrt(nx * nx + ny * ny + nz * nz);
  384. X          nx = nx / len + tmp.x;
  385. X          ny = ny / len + tmp.y;
  386. Xdiff -c -r sipp-2.0/libsipp/geometric.c sipp-2.0.1/libsipp/geometric.c
  387. X*** sipp-2.0/libsipp/geometric.c    Thu Dec 20 15:10:49 1990
  388. X--- sipp-2.0.1/libsipp/geometric.c    Mon Apr 22 18:51:11 1991
  389. X***************
  390. X*** 58,64 ****
  391. X  /*
  392. X   * Set MAT to the transformation matrix that represents the 
  393. X   * concatenation between the previous transformation in MAT
  394. X!  * and a translation along the Vector VEC.
  395. X   *
  396. X   * [a  b  c  0]   [ 1  0  0  0]     [ a     b     c    0]
  397. X   * [d  e  f  0]   [ 0  1  0  0]     [ d     e     f    0]
  398. X--- 58,64 ----
  399. X  /*
  400. X   * Set MAT to the transformation matrix that represents the 
  401. X   * concatenation between the previous transformation in MAT
  402. X!  * and a translation along the vector described by DX, DY and DZ.
  403. X   *
  404. X   * [a  b  c  0]   [ 1  0  0  0]     [ a     b     c    0]
  405. X   * [d  e  f  0]   [ 0  1  0  0]     [ d     e     f    0]
  406. X***************
  407. X*** 202,209 ****
  408. X      mat_rotate_z(mat, -ang2);
  409. X      mat_rotate_y(mat, -ang3);
  410. X      mat_rotate_z(mat, ang);
  411. X-     mat_rotate_z(mat, ang2);
  412. X      mat_rotate_y(mat, ang3);
  413. X      mat_translate(mat, point->x, point->y, point->z);
  414. X  }
  415. X  
  416. X--- 202,209 ----
  417. X      mat_rotate_z(mat, -ang2);
  418. X      mat_rotate_y(mat, -ang3);
  419. X      mat_rotate_z(mat, ang);
  420. X      mat_rotate_y(mat, ang3);
  421. X+     mat_rotate_z(mat, ang2);
  422. X      mat_translate(mat, point->x, point->y, point->z);
  423. X  }
  424. X  
  425. X***************
  426. X*** 212,218 ****
  427. X  /*
  428. X   * Set MAT to the transformation matrix that represents the 
  429. X   * concatenation between the previous transformation in MAT
  430. X!  * and a scaling with the scaling factors in the Vector scale.
  431. X   *
  432. X   * [a  b  c  0]   [Sx  0  0  0]     [a*Sx  b*Sy  c*Sz  0]
  433. X   * [d  e  f  0]   [ 0 Sy  0  0]     [d*Sx  e*Sy  f*Sz  0]
  434. X--- 212,218 ----
  435. X  /*
  436. X   * Set MAT to the transformation matrix that represents the 
  437. X   * concatenation between the previous transformation in MAT
  438. X!  * and a scaling with the scaling factors XSCALE, YSCALE and ZSCALE
  439. X   *
  440. X   * [a  b  c  0]   [Sx  0  0  0]     [a*Sx  b*Sy  c*Sz  0]
  441. X   * [d  e  f  0]   [ 0 Sy  0  0]     [d*Sx  e*Sy  f*Sz  0]
  442. X***************
  443. X*** 242,248 ****
  444. X   * Set MAT to the transformation matrix that represents the
  445. X   * concatenation between the previous transformation in MAT
  446. X   * and a mirroring in the plane defined by the point POINT
  447. X!  * and the normal vector NORMAL.
  448. X   */
  449. X  
  450. X  void
  451. X--- 242,248 ----
  452. X   * Set MAT to the transformation matrix that represents the
  453. X   * concatenation between the previous transformation in MAT
  454. X   * and a mirroring in the plane defined by the point POINT
  455. X!  * and the normal vector NORM.
  456. X   */
  457. X  
  458. X  void
  459. XOnly in sipp-2.0.1/libsipp: patchlevel.h
  460. Xdiff -c -r sipp-2.0/libsipp/sipp.c sipp-2.0.1/libsipp/sipp.c
  461. X*** sipp-2.0/libsipp/sipp.c    Thu Dec 20 15:20:25 1990
  462. X--- sipp-2.0.1/libsipp/sipp.c    Mon Apr 22 19:17:24 1991
  463. X***************
  464. X*** 3,10 ****
  465. X   *
  466. X   *  A general 3d graphic package
  467. X   *
  468. X!  *  Copyright Jonas Yngvesson  (jonas-y@isy.liu.se) 1988/89/90
  469. X!  *            Inge Wallin      (ingwa@isy.liu.se)         1990
  470. X   *
  471. X   * This program is free software; you can redistribute it and/or modify
  472. X   * it under the terms of the GNU General Public License as published by
  473. X--- 3,10 ----
  474. X   *
  475. X   *  A general 3d graphic package
  476. X   *
  477. X!  *  Copyright Jonas Yngvesson  (jonas-y@isy.liu.se) 1988/89/90/91
  478. X!  *            Inge Wallin      (ingwa@isy.liu.se)         1990/91
  479. X   *
  480. X   * This program is free software; you can redistribute it and/or modify
  481. X   * it under the terms of the GNU General Public License as published by
  482. X***************
  483. X*** 19,24 ****
  484. X--- 19,30 ----
  485. X   *
  486. X   * Revision history:
  487. X   *
  488. X+  * 910412  Ver. 2.0.1. Some minor bugfixes. Division by zero in
  489. X+  *         create_edges() if an edge was horizontal in both x and y.
  490. X+  *         Free-list became corrupted since the y_bucket was freed
  491. X+  *         twice. Wrong parameters to (D)noise() in bumpy.c. Two lines
  492. X+  *         interchanged in mat_rotate(). A few other minor changes.
  493. X+  *
  494. X   * 901219  At last! 2.0 is out of the bag. And right in time for X-mas :-)
  495. X   *         *Major* rewrite. A new level in the object hierarchy introduced.
  496. X   *         An object is now a collection of surfaces and other objects
  497. X***************
  498. X*** 83,89 ****
  499. X  #include <geometric.h>
  500. X  
  501. X  
  502. X! #define VERSION "2.0"
  503. X  
  504. X  #define ZCLIPF 100.0        /* Magic number used when defining hither & yon */
  505. X  
  506. X--- 89,95 ----
  507. X  #include <geometric.h>
  508. X  
  509. X  
  510. X! #define VERSION "2.0.1"
  511. X  
  512. X  #define ZCLIPF 100.0        /* Magic number used when defining hither & yon */
  513. X  
  514. X***************
  515. X*** 92,110 ****
  516. X  /*
  517. X   * Global variables.
  518. X   */
  519. X! static Vertex      *vertex_tree;     /* Vertex tree for current object. */
  520. X! static Vertex_ref  *vertex_stack;    /* Vertex stack for current polygon. */
  521. X! static Vertex_ref  *vstack_bottom;   /* Last entry in vertex stack. */
  522. X! static Polygon     *poly_stack;      /* Polygon stack for current object. */
  523. X! static Inst_object *object_db;       /* Object database. */
  524. X! static Lightsource *lightsrc_stack;  /* Lightsource list. */
  525. X! static Bucket      *y_bucket;        /* Y-bucket for edge lists. */
  526. X! static double       dist_limit;      /* Minimal distance between two      */
  527. X!                                      /* vertices without them being       */
  528. X!                                      /* considered to be the same vertex. */
  529. X! static int          first_vertex;    /* Used when determining if we are   */
  530. X!                                      /* installing the first vertex in an */
  531. X!                                      /* object. *Not* a boolean!          */
  532. X  
  533. X  /*
  534. X   * Stack of transformation matrices used
  535. X--- 98,116 ----
  536. X  /*
  537. X   * Global variables.
  538. X   */
  539. X! static Vertex       *vertex_tree;     /* Vertex tree for current object. */
  540. X! static Vertex_ref   *vertex_stack;    /* Vertex stack for current polygon. */
  541. X! static Vertex_ref   *vstack_bottom;   /* Last entry in vertex stack. */
  542. X! static Polygon      *poly_stack;      /* Polygon stack for current object. */
  543. X! static Inst_object  *object_db;       /* Object database. */
  544. X! static Lightsource  *lightsrc_stack;  /* Lightsource list. */
  545. X! static Edge        **y_bucket;        /* Y-bucket for edge lists. */
  546. X! static double        dist_limit;      /* Minimal distance between two      */
  547. X!                                       /* vertices without them being       */
  548. X!                                       /* considered to be the same vertex. */
  549. X! static int           first_vertex;    /* Used when determining if we are   */
  550. X!                                       /* installing the first vertex in an */
  551. X!                                       /* object. *Not* a boolean!          */
  552. X  
  553. X  /*
  554. X   * Stack of transformation matrices used
  555. X***************
  556. X*** 1297,1303 ****
  557. X                      edge->wstep = wstep;
  558. X                  }
  559. X              } else {
  560. X!                 zstep = (z2 - z1) / fabs(x2 - x1);
  561. X                  edge = (Edge *)smalloc(sizeof(Edge));
  562. X                  edge->y = y2;
  563. X                  edge->y_stop = y1;
  564. X--- 1303,1313 ----
  565. X                      edge->wstep = wstep;
  566. X                  }
  567. X              } else {
  568. X!                 if (x2 != x1) {
  569. X!                     zstep = (z2 - z1) / fabs(x2 - x1);
  570. X!                 } else {
  571. X!                     zstep = z2 - z1;
  572. X!                 }
  573. X                  edge = (Edge *)smalloc(sizeof(Edge));
  574. X                  edge->y = y2;
  575. X                  edge->y_stop = y1;
  576. X***************
  577. X*** 1315,1328 ****
  578. X              }
  579. X              edge->polygon = polygon;
  580. X              edge->surface = surface;
  581. X!             edge->next = NULL;
  582. X!             if (y_bucket[edge->y].last == NULL) {
  583. X!                 y_bucket[edge->y].first = edge;
  584. X!                 y_bucket[edge->y].last = edge;
  585. X!             } else {
  586. X!                 y_bucket[edge->y].last->next = edge;
  587. X!                 y_bucket[edge->y].last = edge;
  588. X!             }
  589. X          }
  590. X      } while (view_ref != last);
  591. X  }
  592. X--- 1325,1332 ----
  593. X              }
  594. X              edge->polygon = polygon;
  595. X              edge->surface = surface;
  596. X!             edge->next = y_bucket[edge->y];
  597. X!             y_bucket[edge->y] = edge;
  598. X          }
  599. X      } while (view_ref != last);
  600. X  }
  601. X***************
  602. X*** 1605,1613 ****
  603. X      stmp = scanline1;
  604. X   
  605. X      while (y >= 0) {
  606. X!         active_list = merge_edge_lists(active_list, y_bucket[y].first);
  607. X          next_edge = y - 1;
  608. X!         while (next_edge >=0 && y_bucket[next_edge].first == NULL)
  609. X              next_edge--;
  610. X          while (y > next_edge) {
  611. X              init_buffers(xres, z_buffer, stmp);
  612. X--- 1609,1617 ----
  613. X      stmp = scanline1;
  614. X   
  615. X      while (y >= 0) {
  616. X!         active_list = merge_edge_lists(active_list, y_bucket[y]);
  617. X          next_edge = y - 1;
  618. X!         while (next_edge >=0 && y_bucket[next_edge] == NULL)
  619. X              next_edge--;
  620. X          while (y > next_edge) {
  621. X              init_buffers(xres, z_buffer, stmp);
  622. X***************
  623. X*** 1796,1820 ****
  624. X  }
  625. X  
  626. X  
  627. X- /*
  628. X-  * Free the memory used by an edge list.
  629. X-  */
  630. X- static void
  631. X- delete_edges(edge_list)
  632. X-     Edge *edge_list;
  633. X- {
  634. X-     Edge *edgeref1, *edgeref2;
  635. X  
  636. X-     edgeref1 = edge_list;
  637. X-     while (edgeref1 != NULL) {
  638. X-         edgeref2 = edgeref1->next;
  639. X-         free(edgeref1);
  640. X-         edgeref1 = edgeref2;
  641. X-     }
  642. X- }
  643. X- 
  644. X- 
  645. X- 
  646. X  /*
  647. X   * Push the current transformation matrix on the matrix stack.
  648. X   */
  649. X--- 1800,1806 ----
  650. X***************
  651. X*** 1904,1910 ****
  652. X  
  653. X                  if (!polyref->backface) {
  654. X                      transf_vertices(polyref->vertices, surfref, loc_view_mat, 
  655. X!                                     &curr_mat, (double)xres, (double)yres);
  656. X                  }
  657. X  
  658. X              }
  659. X--- 1890,1897 ----
  660. X  
  661. X                  if (!polyref->backface) {
  662. X                      transf_vertices(polyref->vertices, surfref, loc_view_mat, 
  663. X!                                     &curr_mat, (double)(xres >> 1),
  664. X!                                     (double)(yres >> 1));
  665. X                  }
  666. X  
  667. X              }
  668. X***************
  669. X*** 1951,1970 ****
  670. X      double      matrix[4][4];
  671. X      int         i;
  672. X  
  673. X!     y_bucket = (Bucket *)calloc(yres << 1, sizeof(Bucket));
  674. X  
  675. X      get_view_transf(matrix);
  676. X      MatCopy(&curr_mat, &ident_matrix);
  677. X      
  678. X!     traverse_object_db(object_db, matrix, xres, yres);
  679. X  
  680. X      vecnorm(&camera.vec);
  681. X      scan_and_render(xres << 1, yres << 1, image_file);
  682. X      view_vec_eval();
  683. X- 
  684. X-     for (i = 0; i < (yres << 1); i++)
  685. X-         delete_edges(y_bucket[i].first);
  686. X-     free(y_bucket);
  687. X  }
  688. X  
  689. X  
  690. X--- 1938,1953 ----
  691. X      double      matrix[4][4];
  692. X      int         i;
  693. X  
  694. X!     y_bucket = (Edge **)calloc(yres << 1, sizeof(Edge *));
  695. X  
  696. X      get_view_transf(matrix);
  697. X      MatCopy(&curr_mat, &ident_matrix);
  698. X      
  699. X!     traverse_object_db(object_db, matrix, xres << 1, yres << 1);
  700. X  
  701. X      vecnorm(&camera.vec);
  702. X      scan_and_render(xres << 1, yres << 1, image_file);
  703. X      view_vec_eval();
  704. X  }
  705. X  
  706. X  
  707. Xdiff -c -r sipp-2.0/libsipp/sipptypes.h sipp-2.0.1/libsipp/sipptypes.h
  708. X*** sipp-2.0/libsipp/sipptypes.h    Sat Nov 17 01:43:53 1990
  709. X--- sipp-2.0.1/libsipp/sipptypes.h    Thu Mar 21 20:55:12 1991
  710. X***************
  711. X*** 41,54 ****
  712. X  
  713. X  
  714. X  /*
  715. X-  * Y-bucket to keep the edge lists
  716. X-  */
  717. X- typedef struct {
  718. X-     Edge *first, *last;   /* Firs and last entry in the list */
  719. X- } Bucket;
  720. X- 
  721. X- 
  722. X- /*
  723. X   * Objects installed in the database for rendering are kept
  724. X   * in a binary tree, internal to sipp. This database will
  725. X   * automatically contain all top level objects, but the user
  726. X--- 41,46 ----
  727. X-- 
  728. END_OF_FILE
  729.   if test 22161 -ne `wc -c <'Patch01'`; then
  730.     echo shar: \"'Patch01'\" unpacked with wrong size!
  731.   fi
  732.   # end of 'Patch01'
  733. fi
  734. echo shar: End of archive.
  735. exit 0
  736. ------------------------------------------------------------------------------
  737. J o n a s   Y n g v e s s o n
  738. Dept. of Electrical Engineering                             jonas-y@isy.liu.se
  739. University of Linkoping, Sweden                   ...!uunet!isy.liu.se!jonas-y
  740. exit 0 # Just in case...
  741. -- 
  742. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  743. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  744. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  745. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  746.